<template>
  <div>
    <el-input placeholder="请输入充值金额" v-model="money"></el-input>
        <el-button @click="top_up">充值</el-button>
    <template>
        
      <el-table :data="tableData">

        <el-table-column prop="mobile" label="手机号">
        </el-table-column>

        <el-table-column prop="money" label="余额">
        </el-table-column>

        <el-table-column prop="lock_money" label="锁定金额">
        </el-table-column>
      </el-table>
    </template>
    <div>

    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
        tableData:[],
        user_id:localStorage.getItem('user_id'),
        money:"",
    };
  },
  methods: {
    getuser(){
        this.axios.get('/get_user?user_id=' + this.user_id).then(resp=>{
            console.log(resp)
            this.tableData = resp.data.data
        })
    },
    top_up(){
        this.axios.get('/topup_user?user_id=' + this.user_id + '&money=' + this.money).then(resp=>{
            console.log(resp)
            window.location.href = resp.data.url
        })
    }
  },
  mounted() {
    this.getuser()
  },
};
</script>

<style>
</style>